import { redirect } from 'next/navigation';
import Link from 'next/link';
import { ArrowLeft } from 'lucide-react';

interface SearchPageProps {
  searchParams: { name?: string };
}

export default function SearchPage({ searchParams }: SearchPageProps) {
  const { name } = searchParams;
  
  // 如果有搜索参数，则重定向到首页
  if (name) {
    redirect('/');
  }
  
  return (
    <div className="min-h-screen bg-[#1a1d24] text-white py-8">
      <div className="container mx-auto px-4">
        <div className="mb-6">
          <Link href="/" className="inline-flex items-center gap-2 text-gray-400 hover:text-white">
            <ArrowLeft className="h-4 w-4" />
            <span>返回首页</span>
          </Link>
        </div>
        
        <div className="text-center py-12">
          <h1 className="text-xl font-medium mb-4">搜索功能已更新</h1>
          <p className="mb-6">请使用页面顶部的搜索栏搜索玩家</p>
          <Link
            href="/"
            className="inline-block px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition"
          >
            返回首页
          </Link>
        </div>
      </div>
    </div>
  );
} 